//
//  ScrollerView.m
//  UIHomeWork05-相册轮播图
//
//  Created by tusm on 16/7/21.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ScrollerView.h"

@implementation ScrollerView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame image:(UIImage *)image {
    
    self = [super initWithFrame:frame];
    if (self) {
        //大的scrollview
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        self.imageView.image = image;
        [self addSubview:_imageView];
        // 小
        self.minimumZoomScale = 0.5;
        self.maximumZoomScale = 2;
        self.delegate = self;
        
    }
    return self;
}


/** 缩小图片的方法 */
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
    
    return self.imageView;
}




@end
